<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;



use app\common\model\UserLevel;

/**
 * 配置控制器
 */
class Financial extends AdminBase
{

    /**
     * 理财记录列表
     */
    public function get_trade_list()
    {



        $this->assign('list', $this->logicFinancial->get_trade_list($this->param,'a.*,c.username','a.create_time desc',50));
        $this->assign('param',$this->param);
        return $this->fetch();
    }


    /**
     * 委托撤单
     */
    public function cancel_entrust()
    {


        $this->jump($this->logicFinancial->cancel_entrust($this->param));

    }


    /**
     * 查看粉丝列表
     */
    public function get_fans_list()
    {




        $this->assign('list', $this->logicFinancial->get_trade_list($this->param,'a.*,c.username','a.create_time desc',50));
        $this->assign('param',$this->param);
        return $this->fetch();
    }


    /**
     * 红利释放记录列表
     */
    public function get_bonus_list()
    {



        $this->assign('list', $this->logicFinancial->get_bonus_list($this->param,'a.*,c.username','a.create_time desc',50));
        $this->assign('param',$this->param);
        return $this->fetch();
    }

    /**
     * 会员导出
     */
    public function exportTradeList()
    {

        // $where = $this->logicMember->getWhere($this->param);

        $this->logicFinancial->exportTradeList($this->param);
    }



    /**
     * 等级配置列表
     */
    public function level_list()
    {



        $this->assign('list', UserLevel::all(['status'=>1]));

        return $this->fetch();
    }
    /**
     * 等级配置列表
     */
    public function add_level()
    {



        IS_POST && $this->jump($this->logicFinancial->LevelEdit($this->param));




        return $this->fetch('edit_level');
    }
    /**
     * 等级配置列表
     */
    public function edit_level()
    {



        IS_POST && $this->jump($this->logicFinancial->LevelEdit($this->param));

        $info = UserLevel::get($this->param['id']);
        $this->assign('info', $info);


        return $this->fetch();
    }

    /**
     * 红利释放记录列表
     */
    public function bets_log()
    {



        $this->assign('list', $this->logicFinancial->bets_log($this->param,'a.*,c.username','a.create_time desc',50));
        $this->assign('param',$this->param);
        return $this->fetch();
    }

    /**
     * 导出
     */
    public function exportBetsList()
    {

        // $where = $this->logicMember->getWhere($this->param);

        $this->logicFinancial->exportBetsList($this->param);
    }


}
